﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
using ZLDC.Common.Estate;

namespace ZLDC.Estate.Quantify
{
    public partial class lp_Appointment : System.Web.UI.Page
    {
        protected int pagesize = 20;
        protected  int Pcount = 0;
        protected int Ppcount = 0;//完成人数工作
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = _Request.GetString("type","0");
            string starttime = _Request.GetString("starttime", "0");
            if (!IsPostBack)
            {
                if (type != "0")
                {
                    txtTime.Text = starttime;
                    //txtendtime.Text = starttime;
                    GetList(0, RpList, starttime);
                }
                else
                {
                    txtTime.Text = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
                    //txtendtime.Text = DateTime.Now.AddDays(1).ToString("yyyy-MM-dd");
                }
            }
        }

        #region 查询部门用户
        protected void GetList(int Pcount,Repeater Rplist,string txtTime)
        {
            ZLDC.Topo.BLL.Estate.lp_Appointment.GetList(Pcount, RpList,txtTime);
        }
        #endregion

        protected void Button1_Click(object sender, EventArgs e)
        {
            ZLDC.Topo.BLL.Estate.lp_Appointment.BtnAdd(txtTime.Text, RpList, Ppcount, Pcount, Page, txtTime.Text);
        }

        protected void btnExistsTime_Click(object sender, EventArgs e)
        {
          if(Exists()==0)
            GetList(Pcount, RpList,txtTime.Text);
        }

        protected int Exists()
        {
            return ZLDC.Topo.BLL.Estate.lp_Appointment.Exists(txtTime.Text, txtTime.Text, _Utility.GetInfoBySession().m_sDeptID, Page, aexists, RpList);
        }
      
    }
}
